
# stores player info, especially inventory
class Player:
    def __init__(self):
        self.inventory = {}
        self.inventoryLimit = 4;
    
    # adds item to the inventory for this player
    def add_item(self,item):
        
        self.inventory[item.get_id()] = item
        return
    
    def has_item(self,item_id):
        return self.inventory.has_key(item_id)
    
    # remove and return item from inventory (if it is there)
    # otherwise return empty string
    def pop_item(self,item_id):
        
        return self.inventory.pop(item_id,'')
    
    # check if the player can pick up another item
    def can_pickup(self):
        return len(self.inventory) < self.inventoryLimit
    
    def get_alert(self):
        alert =""
        if not self.can_pickup():
            alert = "MacGyver cannot carry any more items, drop some in order to acquire others."
        return alert
    
    def get_pumped(self):
        self.inventoryLimit += 1;